package com.lxy.exportword.service.impl;


import com.lxy.exportword.entity.jiangdu.ExceptionSummarize;
import com.lxy.exportword.entity.jiangdu.JiangDuHeader;
import com.lxy.exportword.service.IJiangDuService;
import com.lxy.exportword.util.WordUtil;
import org.springframework.stereotype.Service;

import java.beans.IntrospectionException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author: sun
 * @time: 2021/9/12 17:31
 */
@Service
public class JiangDuServiceImpl implements IJiangDuService {

    //讲渡异常点情况识别汇总 表格
    @Override
    public List<ExceptionSummarize> getAllTableExceptions() {
         List<ExceptionSummarize> list=new ArrayList<>();
        list.add(new ExceptionSummarize("1","讲渡线B段","22.40","本次巡检无异常点。","第二十八次"));
        list.add(new ExceptionSummarize("2","讲渡线B段","22.40","本次巡检无异常点。","第二十八次"));
        return list;
    }

    @Override
    public Map<String, Object> getMap() {
        Map<String, Object> map=null;
        try {
            //填充map 反射
            map=WordUtil.getAllFieldNameAndValueToMap(new JiangDuHeader("1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1","1"));
        } catch (IntrospectionException e) {
            e.printStackTrace();
        }

        return map;
    }
}
